package apiUtils.models;

import android.os.Parcel;
import android.os.Parcelable;

import apiUtils.models.util.ModelFilterAble;

/**
 * Created by Administrator on 2017/8/22.
 */

public class ChannelModel implements Parcelable, ModelFilterAble {
    public static final Parcelable.Creator<ChannelModel> CREATOR = new Parcelable.Creator<ChannelModel>() {
        @Override
        public ChannelModel createFromParcel(Parcel source) {
            return new ChannelModel(source);
        }

        @Override
        public ChannelModel[] newArray(int size) {
            return new ChannelModel[size];
        }
    };
    private String channelCode;
    private String channelName;

    public ChannelModel() {
    }

    public ChannelModel(String channelId, String channelName) {
        this.channelCode = channelId;
        this.channelName = channelName;
    }

    protected ChannelModel(Parcel in) {
        this.channelCode = in.readString();
        this.channelName = in.readString();
    }

    public String getChannelCode() {
        return channelCode;
    }

    public void setChannelCode(String channelCode) {
        this.channelCode = channelCode;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.channelCode);
        dest.writeString(this.channelName);
    }

    @Override
    public String getFilterData() {
        return channelName;
    }
}
